import formBuilder from "@/comps/form/formBuilder";
import api from "./api";
/*
fb.addText("sn","单号",3)
fb.addText("item","物品",3)
fb.addText("type","入库类型",3)
fb.addText("isCanceled","是否冲红",3)
fb.addText("numIn","入库数量",3)
fb.addText("numInReal","入库数量",3)
fb.addText("numOut","出库数量",3)
fb.addText("numLeft","剩余数量",3)
fb.addText("batchCode","批次号",3)
fb.addText("batchPrice","批次价格",3)
fb.addText("cost","总价",3)
fb.addText("costReal","总价",3)
fb.addText("heapCode","堆号",3)
fb.addText("pos","库位号",3)
fb.addText("supplier","供应商",3)
fb.addText("brand","品牌",3)
fb.addText("link","Link",3)
fb.addText("linkTo","LinkTo",3)
fb.addText("note","备注",3)
fb.addText("createBy","创建人ID",3)
fb.addText("createName","创建人",3)

* */
export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addText("name").setSpan(3).setLabel("姓名")

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()

        return fb
    },
    tree:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addCascade("parentId").setLabel("上级分类").setSpan(3)
            .setApi(api.urlTree)

        fb.addText("name").setSpan(6).setLabel("分类名称")
            .setRules([fb.R.notNull("名称不能为空")])

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()
        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}